<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="Bookmark" href="/favicon.ico" >
<link rel="Shortcut Icon" href="/favicon.ico" />
<link rel="stylesheet" type="text/css" href="/admin/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/admin/lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/css/style.css" />
<title>添加借款申请 - H-ui.admin v3.0</title>
<meta name="keywords" content="H-ui.admin v3.0,H-ui网站后台模版,后台模版下载,后台管理系统模版,HTML后台模版下载">
<meta name="description" content="H-ui.admin v3.0，是一款由国人开发的轻量级扁平化网站后台模板，完全免费开源的网站后台管理系统模版，适合中小型CMS后台系统。">
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 借款管理 <span class="c-gray en">&gt;</span> 借款申请<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<article class="page-container" style="width:80%">
	<form action="" method="get" class="form form-horizontal" id="form-member-add">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>申请人：</label>
			<div class="formControls col-xs-8 col-sm-9" style="width:30%">
				<input type="text" class="input-text" value="${Session['oauser'].userUsername}" readonly="readonly"  id="userusername" name="userName">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>部门：</label>
			<div class="formControls col-xs-8 col-sm-9" style="width:30%">
				<input type="text" class="input-text" value="${Session['oauser'].oaDept.deptName}" readonly="readonly" id="deptname" name="deptName">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>申请日期：</label>
			<div class="formControls col-xs-8 col-sm-9" style="width:30%">
				<input type="text" class="input-text" value="${.now?string('yyyy-MM-dd')}" readonly="readonly"  id="applyDate" name="applyDate">
			</div>
		</div>
		
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>使用日期</label>
			<div class="formControls col-xs-8 col-sm-9" >
				<input type="text" readonly="readonly" name="useDate"  onfocus="WdatePicker({minDate:'%y-%M-{%d+1}',minDate:'%y-%M-%d'} )" id="useDate" class="input-text Wdate" style="width:120px;">&nbsp;日&nbsp;
				
			</div>
		</div>
		
		<div class="row cl" >
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>借款类别：</label>
			<div class="formControls col-xs-8 col-sm-9" style="width:30%"> <span class="select-box">
				<select class="select" size="1" name="borrowId" id="borrowId">
					<option value="" selected>请选择类别</option>
					<#list borrow as b>
    					<option value="#{b.borrowId}">${b.borrowType}</option>
    				</#list>
				</select>
				</span>
			 </div>
		</div>

		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>借款金额：</label>
			<div class="formControls col-xs-8 col-sm-9" >
				<input type="text" class="input-text" placeholder="" id="applyMoney"  name="applyMoney">
			</div>
		</div>

		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>申请主题：</label>
			<div class="formControls col-xs-8 col-sm-9" >
				<input type="text" class="input-text" placeholder=""  id="applyTitle"  name="applyTitle">
			</div>
		</div>
		
		
		
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">申请事由【说明该款的用途】：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<textarea  cols="" rows="" id="applyContext"  name="applyContext" class="textarea"  placeholder="可选...填写可便于理解" onKeyUp="$.Huitextarealength(this,100)"></textarea>
				<p class="textarea-numberbar"><em class="textarea-length">0</em>/200</p>
			</div>
		</div>
	
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*注意：</span></label>
			<div class="formControls col-xs-8 col-sm-9">
				<textarea name="beizhu" style="font-size:14 px;height:68px;color:#F00;resize:none;overflow:hidden;" readonly="readonly"  class="textarea">
		填写日期时，请认真填写相关日期。
		1、申请事由为可选项，默认为无，方便领导审阅；
		2、如有疑问请联系人事部门；</textarea>
			</div>
		</div>
		
			
		<div class="row cl" >
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
				<input class="btn btn-primary radius" id="saveBtn" name="applySubmit" type="button" value="&nbsp;&nbsp;保存&nbsp;&nbsp;">
				<input class="btn btn-default radius" id="update"  type="button" name="applySubmit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
				<input class="btn btn-default radius" id="cancelBtn" type="button" name="applySubmit" value="&nbsp;&nbsp;取消&nbsp;&nbsp;">
			</div>
		</div>
	</form>
</article>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="/admin/lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="/admin/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="/admin/static/h-ui/js/H-ui.min.js"></script> 
<script type="text/javascript" src="/admin/static/h-ui.admin/js/H-ui.admin.js"></script>
<!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本  id="checkbeginday" name="checkbeginday" --> 
<!--日历插件-->
<script type="text/javascript" src="/admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="/admin/lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
<script type="text/javascript" src="/admin/lib/jquery.validation/1.14.0/validate-methods.js"></script> 
<script type="text/javascript" src="/admin/lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript">
 var butt;
	 
	var editUser = function(){
		if(!check().form()){ 
			return;  	
		}
		$.ajax({
			   type: "GET",
			   dataType: "json",
			   url: "/applyMoney/addApply",
			   data: {					
					"userName": $("#userusername").val(),
					"deptName": $("#deptname").val(),
					"applyDate": $("#applyDate").val(),
					"useDate": $("#useDate").val(),
					"borrowId": $("#borrowId").val(),
					"applyMoney": $("#applyMoney").val(),
					"applyTitle": $("#applyTitle").val(),
					"applyContext": $("#applyContext").val(),
					"applyContext": $("#applyContext").val(),
					"applySubmit" : butt
			   },
			   success: function(msg){ 
					 $('#cancelBtn').click(); 	
			    }
		});
	}
	
	$('#saveBtn').on('click', function(){
		butt='保存';
		editUser();
	});
	
	$('#update').on('click', function(){
		 butt='提交';
		editUser();
	});
	
	 $('#cancelBtn').on('click', function(){
		var index = parent.layer.getFrameIndex(window.name);
		parent.getUserPageList();
		parent.layer.close(index);
	}); 

//校验字段是否正确 
 function check(){   
    /*返回一个validate对象，这个对象有一个form方法，返回的是是否通过验证*/ 
     return $("#form-member-add").validate({ 
    	 rules:{
 			userName:{
 				required:true,
 			},
 			deptName:{
 				required:true,
 			},
 			applyDate:{
 				required:true,
 			},
 			useDate:{
 				required:true,
 			},
 			borrowId:{
 				required:true,
 			},
 			applyMoney:{
 				required:true,
 			},
 			applyTitle:{
 				required:true,
 			},
 			applyContext:{
 				required:true,
 			},
 		},
                  
            }); 
}  
</script> 
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>